﻿<Window x:Class="WpfWordsLearner.Views.AddWordsView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
        xmlns:local="clr-namespace:WpfWordsLearner"
        xmlns:mv="clr-namespace:WpfWordsLearner.ViewModels"
        Title="Add Words View"
        Width="300"
        Height="200">
	<Window.Resources>
		<mv:AddWordsViewModel x:Key="VM" />
	</Window.Resources>
	<Grid DataContext="{StaticResource VM}">
		<Grid.RowDefinitions>
			<RowDefinition />
			<RowDefinition />
			<RowDefinition />
		</Grid.RowDefinitions>
		<StackPanel DataContext="{Binding Model}">
			<TextBlock Text="English word:" />
			<TextBox x:Name="txtEnglish" Text="{Binding Path=EnglishWord, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
				<i:Interaction.Behaviors>
					<local:WatermarkTextBoxBehavior Watermark="Enter foreign word here.." />
				</i:Interaction.Behaviors>
			</TextBox>
		</StackPanel>
		<StackPanel Grid.Row="1" DataContext="{Binding Model}">
			<TextBlock Text="Translate:" />
			<TextBox x:Name="txtTranslate" Text="{Binding Path=Translate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
				<i:Interaction.Behaviors>
					<local:WatermarkTextBoxBehavior Watermark="Enter translate here.." />
				</i:Interaction.Behaviors>
			</TextBox>
		</StackPanel>
		<StackPanel Grid.Row="2"
		            HorizontalAlignment="Center"
		            Orientation="Horizontal">
			<Button x:Name="btnAdd"
			        Width="50"
			        Height="25"
			        Command="{Binding Source={StaticResource VM},
			                          Path=ClickCommand}"
			        Content="Add" />
			<Button x:Name="btnCancel"
			        Width="50"
			        Height="25"
			        Command="{Binding Source={StaticResource VM},
			                          Path=ClickCommand2}"
			        Content="Cancel"
			        IsCancel="True" />
		</StackPanel>
	</Grid>
</Window>
